# _*_ coding: UTF-8 _*_
# @Time     : 2022/4/22 9:53
# @Author   : Li Jie
# @Site     : http://www.cdtest.cn/
# @File     : 下拉菜单操作.py
# @Software : PyCharm

from selenium import webdriver
import time
from selenium.webdriver.common.by import By


def foo1():
    driver = webdriver.Chrome()

    driver.maximize_window()

    driver.get(r"D:\pyworkspace\t79\selenium3\example.html")

    # 直接将文件路径输入到上传按键的<input>
    driver.find_element(By.NAME, "attach[]").send_keys(r'C:\Users\LiJie\Pictures\1.jpg')

    time.sleep(2)

    driver.quit()


if __name__ == "__main__":
    foo1()
